/**
 * Copyright (c) 快宝网络 kuaidihelp.com Co., Ltd. All Rights Reserved 禁止外泄以及用于其它的商业用途
 */

import { checkAndTriggerRefresh } from '@/components/_pages/red-point/_utils';
import request from '@/utils/request';

// 网点后台
export async function getTransferData(params: any, fromRedDot?: boolean) {
  return request('/invoice/transferData', {
    method: 'POST',
    data: params,
  }).then(checkAndTriggerRefresh(getTransferData, fromRedDot));
}

export async function transferUpdate(params: any) {
  return request('/invoice/transferUpdate', {
    method: 'POST',
    data: params,
  });
}

export async function getShopInfo(params: any) {
  return request('/invoice/getShopInfo', {
    method: 'POST',
    data: params,
  });
}

export async function downloadExcel(params: any) {
  return request('/invoice/dowExcel', {
    method: 'POST',
    data: params,
  });
}

// 开放平台

export async function openInvoiceList(params: any, fromRedDot?: boolean) {
  return request('/invoice/openInvoiceList', {
    method: 'POST',
    data: params,
  }).then(checkAndTriggerRefresh(openInvoiceList, fromRedDot));
}

export async function openInvoiceEdit(params: any) {
  return request('/invoice/openInvoiceEdit', {
    method: 'POST',
    data: params,
  });
}

export async function openInvoiceRechargeStatusEdit(params: any) {
  return request('/invoice/openInvoiceRechargeStatusEdit', {
    method: 'POST',
    data: params,
  });
}
